package org.bapoint.bawirelessprogressusercenter.feign;

import org.bapoint.bawirelessprogressusercenter.service.GetFromDbService;
import org.bapoint.common.response.ServerResponseEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @ClassName OrderFeignClientController
 * @Description TODO
 * @Author 王逸攀
 * @Date 2025/9/11 16:23
 * @Version 1.0
 */
@RestController
public class OrderFeignClientController implements OrderFeignClient {

    @Autowired
    private GetFromDbService getFromDbService;

    @Override
    public ServerResponseEntity<Object> getOrdersAmountAndIfNoCancel(List<Long> orderIds) {
        List<Map<String,Object>> list=  getFromDbService.getFromFeign(orderIds);
        ServerResponseEntity<Object> response = new ServerResponseEntity<>();
        response.setData(list);
        response.setCode("200");
        response.setMsg("微服务调用成功！");
        return response;
    }
}
